﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Security.Cryptography;
using System.Text;

namespace net
{
    class Program
    {
        static void Main(string[] args)
        {
            RSACryptoServiceProvider provider=new RSACryptoServiceProvider();
            provider.KeySize = 2048;
          File.WriteAllText("private.xml" ,provider.ToXmlString(true));
            File.WriteAllText("public.xml" ,provider.ToXmlString(false));

            byte[] xx=provider.SignData(Encoding.UTF8.GetBytes("234234"), CryptoConfig.MapNameToOID("SHA256"));
            bool yy =provider.VerifyData(Encoding.UTF8.GetBytes("234234"), CryptoConfig.MapNameToOID("SHA256"),xx);
        }
    }
}
